package com.hele.sts.dao;

public class Datjxx {

	private int totalEnt;		//企业总数
	private int totalJnml;		//总卷数
	private int totalInml;		//总件数
	private int totalDocPage;	//总页数
	private long totalDocSize;	//总档案大小
	/**
	 * @return the totalEnt
	 */
	public int getTotalEnt() {
		return totalEnt;
	}
	/**
	 * @param totalEnt the totalEnt to set
	 */
	public void setTotalEnt(int totalEnt) {
		this.totalEnt = totalEnt;
	}
	/**
	 * @return the totalJnml
	 */
	public int getTotalJnml() {
		return totalJnml;
	}
	/**
	 * @param totalJnml the totalJnml to set
	 */
	public void setTotalJnml(int totalJnml) {
		this.totalJnml = totalJnml;
	}
	/**
	 * @return the totalInml
	 */
	public int getTotalInml() {
		return totalInml;
	}
	/**
	 * @param totalInml the totalInml to set
	 */
	public void setTotalInml(int totalInml) {
		this.totalInml = totalInml;
	}
	/**
	 * @return the totalDocPage
	 */
	public int getTotalDocPage() {
		return totalDocPage;
	}
	/**
	 * @param totalDocPage the totalDocPage to set
	 */
	public void setTotalDocPage(int totalDocPage) {
		this.totalDocPage = totalDocPage;
	}
	/**
	 * @return the totalDocSize
	 */
	public long getTotalDocSize() {
		return totalDocSize;
	}
	/**
	 * @param totalDocSize the totalDocSize to set
	 */
	public void setTotalDocSize(long totalDocSize) {
		this.totalDocSize = totalDocSize;
	}
	/**
	 * @return the totalDocSizeStr
	 */
	public String getTotalDocSizeStr() {
		return convertFileSize(totalDocSize);
	}
	
	public static String convertFileSize(long size) {
        long kb = 1024;
        long mb = kb * 1024;
        long gb = mb * 1024;
 
        if (size >= gb) {
            return String.format("%.1f GB", (float) size / gb);
        } else if (size >= mb) {
            float f = (float) size / mb;
            return String.format(f > 100 ? "%.0f MB" : "%.1f MB", f);
        } else if (size >= kb) {
            float f = (float) size / kb;
            return String.format(f > 100 ? "%.0f KB" : "%.1f KB", f);
        } else
            return String.format("%d B", size);
    }
}
